<template>
	<view class="pageContent">
		<view class="list" v-if="isShow && headList.length">
			<view class="listItem" :class="index==headIndex ? 'select' : ''" v-for="(item,index) in headList"
				:key="index" @click="selectHead(index)">
				<image class="houseListIm" :src="localImages +'/houseIcon.png'" />
				<view>{{item.roomInfo || ''}} {{item.roomName}}</view>
			</view>
		</view>
		<view class="empty" v-if="isShow && !headList.length">
			<image class="emptyBac" :src="images +'/emptyHosList.png'" />
			<view class="emptyTip">～未找到相关房屋信息～</view>
			<view class="emptyTip">世纪金源物业客服电话：400-991-5888</view>
		</view>
	</view>
</template>

<script>
	import config from '../../static/config.js'
	import util from '../../static/utils/util.js'
	export default {
		data() {
			return {
				images: config.images,
				localImages: config.localImages,
				headList: [],
				headIndex: -1,
				formData: {
					name: "",
					date: "",
					housename: "房屋1",
				},
				isShow: false,
			}
		},
		
		onLoad() {
			setTimeout(() => {
				this.isShow = true
			}, 1000)
			var roomlistTest = [{
				"roleId": 1,
				"ownerId": 32,
				"projectId": 1,
				"roomId": 6,
				"roomName": "房间1601",
				"roomInfo": ""
			}, {}]
			// this.headList=this.roomlist.length ? this.roomlist : roomlistTest
			this.headList = getApp().globalData.roomList || []
		},
		
		methods: {
			selectHead(index) {
				this.headIndex = index;
				var room = this.headList[index]
				getApp().noticeList(room)
			},

			returnMain() {
				wx.reLaunch({
					url: '/pages/index/index'
				})
			},

		},

	}
</script>

<style>
	.pageContent {

		padding: 0rpx 0rpx 0rpx 0rpx;
	}

	.list {
		min-height: 100vh;
		padding: 40rpx 30rpx 0rpx 30rpx;
		background: #F3F6F9;
	}

	.listItem {
		display: flex;
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0px 2px 4px 0px #E1E2E4;
		margin: 0rpx 0rpx 30rpx 0rpx;
		padding: 30rpx 30rpx 30rpx 30rpx;
		border-radius: 16rpx;
	}

	.empty {
		padding: 200rpx 30rpx 0rpx 30rpx;
	}

	.emptyBac {
		width: 100%;
		height: 432rpx;
		margin-bottom: 100rpx;
	}

	.emptyTip {
		font-size: 36rpx;
		color: #A8AFB6;
		line-height: 56rpx;
		text-align: center;
	}

	.memberMain {
		background-color: #FFFFFF;
		padding: 30rpx 30rpx 20rpx 30rpx;
	}

	.memberType {
		border: 1rpx solid #999999;
	}

	.houseListIm {
		width: 50rpx;
		height: 50rpx;
		margin-right: 30rpx;
	}
</style>
